$(function () {
  var returnFloor = function (name) {
      var floor1Dis = document.getElementById(name).offsetTop;
      $('body,html').animate({
        scrollTop: floor1Dis
      }, 500);
  }
  $(window).scroll(function () {
      var showLeftDiv = $(document).scrollTop()
      if (showLeftDiv >= 300) {
        $('#leftFixDiv').show()
      } else {
        $('#leftFixDiv').hide()
      }

      var txt = $('#floor_title5').text()
      if (showLeftDiv <= document.getElementById('floor_title5').offsetTop) {
        $('.navFloor5 a').text(txt[0] + txt[1])
        $('.navFloor5 a').addClass('actived')
        $('.navFloor5').siblings().children('a').removeClass('actived')
      } else {
        $('.navFloor5 a').text('5F')
        $('.navFloor5 a').removeClass('actived')
      }
      var txt = $('#floor_title4').text()
      if (showLeftDiv <= document.getElementById('floor_title4').offsetTop) {
        $('.navFloor4 a').text(txt[0] + txt[1])
        $('.navFloor4 a').addClass('actived')
        $('.navFloor4').siblings().children('a').removeClass('actived')
        $('.navFloor5 a').text('5F')
      } else {
        $('.navFloor4 a').text('4F')
        $('.navFloor4 a').removeClass('actived')
      }
      var txt = $('#floor_title3').text()
      if (showLeftDiv <= document.getElementById('floor_title3').offsetTop) {
        $('.navFloor3 a').text(txt[0] + txt[1])
        $('.navFloor3 a').addClass('actived')
        $('.navFloor3').siblings().children('a').removeClass('actived')
        $('.navFloor4 a').text('4F')
      } else {
        $('.navFloor3 a').text('3F')
        $('.navFloor3 a').removeClass('actived')
      }
      var txt = $('#floor_title2').text()
      if (showLeftDiv <= document.getElementById('floor_title2').offsetTop) {
        $('.navFloor2 a').text(txt[0] + txt[1])
        $('.navFloor2 a').addClass('actived')
        $('.navFloor2').siblings().children('a').removeClass('actived')
        $('.navFloor3 a').text('3F')
      } else {
        $('.navFloor2 a').text('2F')
        $('.navFloor2 a').removeClass('actived')
      }
      var txt = $('#floor_title1').text()
      if (showLeftDiv <= document.getElementById('floor_title1').offsetTop) {
        $('.navFloor1 a').text(txt[0] + txt[1])
        $('.navFloor1 a').addClass('actived')
        $('.navFloor1').siblings().children('a').removeClass('actived')
        $('.navFloor2 a').text('2F')
      } else {
        $('.navFloor1 a').text('1F')
        $('.navFloor1 a').removeClass('actived')
      }

  })
})